package perso.perso.converteur;

import perso.perso.view.tools.PersoViewConstant;

import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;

public class BeanBooleanConverteur implements Converter {

	public boolean canConvert(Class clazz) {
		return clazz.equals(Boolean.class);
	}

	public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
	
	}

	public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
		
			return PersoViewConstant.YES.equals(reader.getValue());
		
	}

}
